package org.begincode.admin.service;

import com.begincode.common.constant.Constant;
import org.begincode.core.mapper.CodeCommentMapper;
import org.begincode.core.model.BlogComment;
import org.begincode.core.model.CodeComment;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by yangsj on 2016/4/28.
 */
@Service
public class CodeService {
    @Resource
    private CodeCommentMapper codeCommentMapper;

    //修改代码评论
    public int  updateCodeCommentById(CodeComment codeComment){
        return codeCommentMapper.updateByPrimaryKeySelective(codeComment);
    }

    //获取未审核代码评论
    public List<CodeComment> selUnCheckCodeComment(){
        CodeComment codeComment = new CodeComment();
        codeComment.setCheckFlag(Constant.UNCHECK);
        return codeCommentMapper.selectBySelective(codeComment);
    }
}
